<?php
/**
 * Created by PhpStorm.
 * User: MF
 * Date: 2017/5/31
 * Time: 21:30
 */


namespace App\Mailer;


use App\User;

class UserMailer extends Mailer
{
	public function followNotifyEmail($email)
	{
		$data =[
			'url'  => env('APP_URL'),
			'name' => \Auth::guard('api')->user()->name
		];

		$this->sendTo('zhihu_new_user_follow', $email, $data);
	}

	public function passwordReset($token, $email)
	{
		$data = [
			'url' => url('password/reset', $token),
		];

		$this->sendTo('zhihu_app_password_reset', $email, $data);
	}

	public function welcome(User $user)
	{
		$data = [
			'url' => route('email.verify', ['token' => $user->confirmation_token]),
			'name' => $user->name
		];

		$this->sendTo('zhihu_app_register', $user->email, $data);
	}
}